package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.CommendReply;
import cn.wolfcode.trip.base.domain.Information;
import cn.wolfcode.trip.base.domain.Tag;
import cn.wolfcode.trip.base.mapper.CommendReplyMapper;
import cn.wolfcode.trip.base.mapper.InformationMapper;
import cn.wolfcode.trip.base.mapper.TagMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.TagQueryObject;
import cn.wolfcode.trip.base.service.ICommendReplyService;
import cn.wolfcode.trip.base.service.IReplyService;
import cn.wolfcode.trip.base.util.UserContext;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class CommendReplyServiceImpl implements ICommendReplyService {
    @Autowired
    private CommendReplyMapper commendReplyMapper;
    @Autowired
    private InformationMapper informationMapper;


    @Override
    public void saveOrUpdate(CommendReply commendReply) {
        Date date = new Date();
        commendReply.setCommendTime(date);
        commendReplyMapper.insert(commendReply);

    }


    @Override
    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize(), qo.getOrderBy());
        List<CommendReply> list = commendReplyMapper.queryByStrategyCommentId(qo);
        return new PageInfo(list);
    }


}
